{extend name="$base_mall" /}
{block name="resources"}
<link rel="stylesheet" type="text/css" href="WAP_CSS/member_point.css">
{/block}
{block name="main"}
{php}
$point_config = api("System.Promotion.pointConfig");
$point_config = $point_config['data'];

// 会员账户信息
$member_account = api("System.Member.memberAccount");
$member_account = $member_account['data'];
{/php}
<div class="member-point">
    <div id="mescroll" class="mescroll" style="top: 44px;">
        <div class="account-box ns-border-color radius-wrapper">
            <p class="balance">{$member_account.salary}</p>
            <p class="p-style">{:lang('member_salary')}</p>
        </div>
        <ul class="list-content radius-wrapper">
        </ul>
    </div>
</div>
{/block}
{block name="footer"}{/block}

{block name="script"}
<script type="text/javascript">
    $(function(){
        mescroll = new ScrollList("mescroll", query_detail);
    });

    function query_detail(page_index, is_append)
    {
        var params = {page_index: page_index,account_type:4};
        var html = "";
        api("System.Member.accountRecordsList", params, function (res) {
            console.log(res)
            var list = res.data;
            if (list.data.length > 0) {
                $(list.data).each(function (i, v) {
                    if(!v.text){
                        v.text = '调整'
                    }
                    html += '<div class="list-content-wrapper" style="position: relative">';
                    html += '<div class="list-content-wrapper-top">';
                    html += '<div class="list-content-wrapper-top-left text16">' + v.text + '</div>';
                    html += '</div>';
                    html += '<div class="list-content-wrapper-bottom">';
                    html += '<div class="list-content-wrapper-bottom-left ns-text-color-gray">' + timeStampTurnTime(v.create_time) + '</div>';
                    html += '</div>';
                    html += '<div class="list-content-wrapper-top-right ns-text-color" style="position: absolute;right: 20px;top: 20px;font-size: 20px" >' + v.number + '</div>';
                    html += '</div>';
                    html += '<div class="line"></div>';
                });
            } else {
                html += '<div class="list-empty-wrapper">';
                html += '<div>';
                html += '<div class="list-empty-img">';
                html += '<img src="' + WAPIMG + '/wap_nodata.png">';
                html += '</div>';
                html += '<div class="list-empty-text">';
                html += '暂无数据';
                html += '</div>';
                html += '</div>';
                html += '</div>';
            }

            if (is_append) $("#mescroll ul").append(html);
            else $("#mescroll ul").html(html);
            mescroll.endByPage(list.total_count, list.page_count);
        });
    }
</script>
{/block}